# -*- coding: utf-8 -*-

import os.path
from cbsettings import DjangoDefaults, switcher

_ROOT = os.path.abspath(os.path.dirname(__file__))


DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
    # ('Your Name', 'your_email@example.com'),
)

MANAGERS = ADMINS

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': 'var/database.db',
    }
}


TIME_ZONE = 'Europe/Moscow'


LANGUAGE_CODE = 'ru'

gettext = lambda s: s

LANGUAGES = (
    ('ru', gettext('Russian')),
    ('en', gettext('English')),
)

MODELTRANSLATION_DEFAULT_LANGUAGE = 'ru'
MODELTRANSLATION_FALLBACK_LANGUAGES = ('ru', 'en')



LOCALE_PATHS = (
    os.path.join(_ROOT, '../conf/locale/'),
)

SITE_ID = 1


USE_I18N = True


USE_L10N = True

USE_TZ = True


MEDIA_ROOT = './var/media'

MEDIA_URL = '/media/'

UPLOAD_TO = os.path.join(MEDIA_ROOT)

STATICFILES_DIRS = (
    ("",os.path.join(_ROOT, 'core/static/')),
)

STATIC_URL = '/static/'
STATIC_ROOT = '/static/'



STATICFILES_DIRS = (
    
)


STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'django.contrib.staticfiles.finders.DefaultStorageFinder',
)


SECRET_KEY = '&amp;pvw^8kpw!1b1%0-wyz)0x$loa6+j+40lp&amp;lf2*9p%n546!er0'


TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
    'django.template.loaders.eggs.Loader',
)

TEMPLATE_CONTEXT_PROCESSORS = (
        'django.contrib.auth.context_processors.auth',
        'django.core.context_processors.debug',
        'django.core.context_processors.i18n',
        'django.core.context_processors.media',
        'django.core.context_processors.static',
        'django.contrib.messages.context_processors.messages',
        'django.core.context_processors.request',
    )

MIDDLEWARE_CLASSES = (
        'django.middleware.common.CommonMiddleware',
        'django.contrib.sessions.middleware.SessionMiddleware',
        'django.middleware.csrf.CsrfViewMiddleware',
        'django.middleware.locale.LocaleMiddleware',
        'django.contrib.auth.middleware.AuthenticationMiddleware',
        'django.contrib.messages.middleware.MessageMiddleware',
)

ROOT_URLCONF = 'blog.urls'

WSGI_APPLICATION = 'blog.wsgi.application'

TEMPLATE_DIRS = (
    'templates/',
    'tpls/',
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.admin',
    'blog',
    'blog.global',
    'blog.posts',
    'blog.addons',
)

MODELTRANSLATION_TRANSLATION_FILES = (
            'blog.translation',
    )

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'filters': {
        'require_debug_false': {
            '()': 'django.utils.log.RequireDebugFalse'
        }
    },
    'handlers': {
        'mail_admins': {
            'level': 'ERROR',
            'filters': ['require_debug_false'],
            'class': 'django.utils.log.AdminEmailHandler'
        }
    },
    'loggers': {
        'django.request': {
            'handlers': ['mail_admins'],
            'level': 'ERROR',
            'propagate': True,
        },
    }
}

import sys
pathname, scriptname =  os.path.split(sys.argv[0])
_PATH = os.path.abspath(pathname)
